#ifndef GRAPHICSITEM_H
#define GRAPHICSITEM_H

#include <QtCore>
#include <QtWidgets/QGraphicsPixmapItem>

class GraphicsItem : public QObject, public QGraphicsPixmapItem
{
public:
    GraphicsItem(int id, const QPixmap &pixmap, QGraphicsItem *parent = nullptr);

    void hoverEnterEvent(QGraphicsSceneHoverEvent *)override;
    void hoverLeaveEvent(QGraphicsSceneHoverEvent *)override;

    int id() const;
    void adjust();
private:
    QTimeLine timeLine;
    int recordId;
    double z;
private:

    void setFrame(int frame);
    void updateItemPosition();

};

#endif // GRAPHICSITEM_H
